Dynomotion

Group: DynoMotion Message: 12410 From: tapiolarikka Date: 10/18/2015
Subject: M47 for kmotion.net

Hi Tom,


How and where in source I should make modifications to get M47- rewind and repeat functionality with kmotion.net?


I now use this in mach coupled with parts counter and target qty for automated machine. Works fine but I'd like to move past mach since there is no updates for mach3 anymore.


Pointers for adding G95 feed/spindle rev would also be very welcome


Rgds,

Tapio

Group: DynoMotion Message: 12416 From: TK Date: 10/19/2015
Subject: Re: M47 for kmotion.net
Hi Tapio,

To implement M47 you would need to modify the GCodeInterpreter.  Mainly the rs274ngc.cpp code starting with the _gees array.  A workaround would be to use a looped subroutine.

Feed/spindle can be accomplished with G32.  What is it that you need to do?

Regards
TK

On 10/18/2015 1:00 PM, tapio.larikka@... [DynoMotion] wrote:
 

Hi Tom,


How and where in source I should make modifications to get M47- rewind and repeat functionality with kmotion.net?


I now use this in mach coupled with parts counter and target qty for automated machine. Works fine but I'd like to move past mach since there is no updates for mach3 anymore.


Pointers for adding G95 feed/spindle rev would also be very welcome


Rgds,

Tapio


Group: DynoMotion Message: 12417 From: Tapio Larikka Date: 10/19/2015
Subject: Re: M47 for kmotion.net

Hi Tom,
 
The G95 is more of a conveniece as I'm used to think feed/rev. Also all cutting data given by mill/insert manufacturers is surface speed/min and feed/rev/teeth.
 
M47 rewind&repeat is used in macro: If TargetQty>ProcessedQty then M47 else M30.
 
I started digging back into the Dynomotion VB.net example and found the "InterpreterUserMCodeCallbackRequested" which I think should make it possible to rewind and restart.
for some yet unkown reason I get error: Method 'Private Sub Testing(code As Integer)' does not have a signature compatible with delegate 'Delegate Function KM_GCodeInterpreterUserMcodeCallbackHandler(code As Integer) As Integer'. 
 
Rgds,
Tapio
 
 
Group: DynoMotion Message: 12418 From: TKSOFT Date: 10/19/2015
Subject: Re: M47 for kmotion.net
Hi Tapio,

Regarding rewind/repeat:could you just loop a subroutine
TargetQty-ProcessedQty number of times?

I think that error is because you defined your callback sub as a sub
with no return parameter. But the callback should have an Integer
return value.

Regards
TK


Quoting "'Tapio Larikka' tapio.larikka@... [DynoMotion]"
<DynoMotion@yahoogroups.com>:

> Hi Tom,
>
> The G95 is more of a conveniece as I'm used to think feed/rev. Also
> all cutting data given by mill/insert manufacturers is surface
> speed/min and feed/rev/teeth.
>
> M47 rewind&repeat is used in macro: If TargetQty>ProcessedQty then
> M47 else M30.
>
> I started digging back into the Dynomotion VB.net example and found
> the "InterpreterUserMCodeCallbackRequested" which I think should
> make it possible to rewind and restart.
> for some yet unkown reason I get error: Method 'Private Sub
> Testing(code As Integer)' does not have a signature compatible with
> delegate 'Delegate Function
> KM_GCodeInterpreterUserMcodeCallbackHandler(code As Integer) As
> Integer'.
>
> Rgds,
> Tapio
>
>
>
Group: DynoMotion Message: 12419 From: Tapio Larikka Date: 10/19/2015
Subject: Re: M47 for kmotion.net

Hi Tom,
 
I could loop in subroutine, but then changing the targetqty would require changing the gcode which also saves all possible mistypings to code opening up possibility of of disaster.
With Mach I now have the targetqty and processedqty dros on mainpage and gcodes are macro generated by user button to eliminate any user errors (meaning users do not tamper with my gcodes :) ) 
 
I'll dig deeper in the vb.net example. Since the interpreter reset/rewind, run and mcode events are available to .net this should be resolvable, also without me tampering with the .cpp sources.
 
Rgds,
Tapio
 
Group: DynoMotion Message: 12433 From: Tapio Larikka Date: 10/25/2015
Subject: Re: M47 for kmotion.net

Hi Tom,
 
Does the feed/spindle with g32 work with mill also?
More generally are all KMotion G codes available for moth mill and lathe?
 
I got the vb.net example so far that visual studio does not report any errors, but I cant get any response from my Mcode (using M100, M47 hangs as expected, since it is unknown)
Do I read the GCodeinterpreter.cpp correctly as I understand that in simulation mode (don't have a board connected) the userMCodecallbacks are ignored?
If so would it be big trouble for you to make a custom GCodeinterpreter.dll that would allow mcodes in sim mode?
 
Rgds,
Tapio
 
Group: DynoMotion Message: 12435 From: TK Date: 10/25/2015
Subject: Re: M47 for kmotion.net
Hi Tapio,

G32 should work for a Mill also but an encoder on the Spindle is required  just like with a Lathe (or you would need to fake and encoder signal).

Currently all GCode is the same for Mill or Lathe with KMotionCNC.

Normally MCodes do hardware operations (coolant, Spindle, Tool Changes, Probes, etc...) that one would want to bypass in simulation mode just like the Axis Motion.  The GCode Interpreter Line:

    if (FlushBeforeUnbufferedOperation && CoordMotion->m_Simulate) return 0;

does this.  I suppose a check could be added for the MCode Action being M_Action_Callback and not return.  You can add that if you wish.  I don't know if it would cause problems for anyone else.

Regards
TK


On 10/25/2015 10:13 AM, 'Tapio Larikka' tapio.larikka@... [DynoMotion] wrote:
 



Hi Tom,
 
Does the feed/spindle with g32 work with mill also?
More generally are all KMotion G codes available for moth mill and lathe?
 
I got the vb.net example so far that visual studio does not report any errors, but I cant get any response from my Mcode (using M100, M47 hangs as expected, since it is unknown)
Do I read the GCodeinterpreter.cpp correctly as I understand that in simulation mode (don't have a board connected) the userMCodecallbacks are ignored?
If so would it be big trouble for you to make a custom GCodeinterpreter.dll that would allow mcodes in sim mode?
 
Rgds,
Tapio
 
Group: DynoMotion Message: 12437 From: Tapio Larikka Date: 10/25/2015
Subject: Re: M47 for kmotion.net

Hi Tom,
 
I did change the    if (FlushBeforeUnbufferedOperation && CoordMotion->m_Simulate) return 0;
to                        if (FlushBeforeUnbufferedOperation ) return 0; //&& CoordMotion->m_Simulate
and managed to compile a working .dll with vs2013 (which bloats to 1.9MB)
but I still don't get any respose from callback, nor does the interpreter stop so it must be something missing.
Interpreterstatusupdated and interpretercomplete are working.
I'll try to attach a copy of  code incase you'd like to take a look
 
Rgds,
Tapio
 

Group: DynoMotion Message: 12438 From: TK Date: 10/25/2015
Subject: Re: M47 for kmotion.net [1 Attachment]
Hi Tapio,

Why not set a breakpoint in the GCodeInterpreter and step through to see what is going on?

Regards
TK

On 10/25/2015 12:04 PM, 'Tapio Larikka' tapio.larikka@... [DynoMotion] wrote:
 



Hi Tom,
 
I did change the    if (FlushBeforeUnbufferedOperation && CoordMotion->m_Simulate) return 0;
to                        if (FlushBeforeUnbufferedOperation ) return 0; //&& CoordMotion->m_Simulate
and managed to compile a working .dll with vs2013 (which bloats to 1.9MB)
but I still don't get any respose from callback, nor does the interpreter stop so it must be something missing.
Interpreterstatusupdated and interpretercomplete are working.
I'll try to attach a copy of  code incase you'd like to take a look
 
Rgds,
Tapio